/*
 * Copyright (c) 2006-2024, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2024-05-28     RT-Thread    first version
 */

#include <rtthread.h>
//#include "drv_common.h"
#include <rtdevice.h>
#define DBG_TAG "main"
#define DBG_LVL DBG_LOG
#include <rtdbg.h>
#include "main.h"
int main(void)
{
    rt_base_t LED1_PIN=0;

    my_mx_init();
//    打印时钟信息

    LOG_D("System Clock information");
    LOG_D("SYSCLK_Frequency = %d", HAL_RCC_GetSysClockFreq());
    LOG_D("HCLK_Frequency   = %d", HAL_RCC_GetHCLKFreq());
    LOG_D("PCLK1_Frequency  = %d", HAL_RCC_GetPCLK1Freq());
    LOG_D("PCLK2_Frequency  = %d", HAL_RCC_GetPCLK2Freq());
    LED1_PIN=rt_pin_get("PB.2");
    rt_pin_mode(LED1_PIN,PIN_MODE_OUTPUT);
    while (1)
    {
        //rt_kprintf("hellorttt!\n");
        //LOG_D("Hello RT-Thread!");
        //测试推送2
        rt_pin_write(LED1_PIN,!rt_pin_read(LED1_PIN));

        rt_thread_delay(500);
    }

    return RT_EOK;
}
